(function (vc) {
    vc.extends({
        data: {
            deleteSystemUserInfo: {}
        },
        _initEvent: function () {
            vc.on('deleteSystemUser','openDeleteSystemUser', function (_staffInfo) {
                $that.deleteSystemUserInfo = _staffInfo;
                $('#deleteSystemUserModel').modal('show');
            });
        },
        methods: {
            closeDeleteSystemUserModel: function () {
                $('#deleteSystemUserModel').modal('hide');
            },
            deleteSystemUser: function () {
                vc.http.apiPost(
                    '/user.deleteSystemUser',
                    JSON.stringify($that.deleteSystemUserInfo),
                    {
                        emulateJSON: true
                    },
                    function (json, res) {
                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                        let _json = JSON.parse(json);
                        vc.toast(_json.msg);
                        if (_json.code == 0) {
                            //关闭model
                            $('#deleteSystemUserModel').modal('hide');
                            vc.emit('systemUser', 'listSystemUser',{});
                           
                            return;
                        }
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                        $that.deleteSystemUserInfo.errorInfo = errInfo;
                    }
                );
            }
        }
    });
})(window.vc);